package com.serviceprovider.business.module.admin.shipping.model;

public class ShipMode {
    private boolean active = true;
    private Integer id;
    private String  mode;
    private Integer price;

    @Override
    public boolean equals(Object obj) {
        if ((obj == null) ||!(obj instanceof ShipMode)) {
            return false;
        }

        ShipMode b  = (ShipMode) obj;
        boolean  eq = ((id == null) && (b.id == null)) || ((id != null) && id.equals(b.id));

        if (!eq) {
            return false;
        }

        eq = ((mode == null) && (b.mode == null)) || ((mode != null) && mode.equals(b.mode));

        return eq && price.equals(b.price) && (active == b.active);
    }

    @Override
    public int hashCode() {
        int prime  = 31;
        int result = 1;

        result = prime * result + ((id == null)
                                   ? 0
                                   : id.hashCode());
        result = prime * result + ((mode == null)
                                   ? 0
                                   : mode.hashCode());
        result = prime * result + (Float.valueOf(price).intValue());
        result = prime * result + ((!active)
                                   ? 0
                                   : 1);

        return result;
    }

    public boolean isActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getMode() {
        return mode;
    }

    public void setMode(String mode) {
        this.mode = mode;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }
}



